為 Kerberos 身分驗證配置 Squid 服務

如果 Kaspersky Web Traffic Security 是從 RPM 或 DEB 軟體套件安裝到即用型作業系統,則這些說明適用。

如果您要用名稱包含根網域名稱 .local 的網域來配置身分驗證,您必須完成以下步驟以便作業系統準備進行正確的 Kerberos 身分驗證。

要為 Kerberos 身分驗證配置 Squid 服務:

  1. 如果正在使用 CentOS 版本 8.x 或 Red Hat Enterprise Linux 版本 8.x 作業系統,配置加密算法使用策略。為此,請執行指令:

    update-crypto-policies --set LEGACY

  2. 複製 squid.keytab 檔案到資料夾 /etc/squid/。
  3. 配置 Keytab 檔案存取權限。為此,請根據所使用的作業系統執行以下指令:
    • CentOS, Red Hat Enterprise Linux 或 SUSE Linux Enterprise Server:

      chown squid:squid /etc/squid/squid.keytab

      chmod 400 /etc/squid/squid.keytab

    • Ubuntu、Debian 或 ALT Server:

      chown proxy:proxy /etc/squid/squid.keytab

      chmod 400 /etc/squid/squid.keytab

    預設情況下,krb5.keytab 檔案擁有者為超級使用者。

  4. 根據作業系統,請將以下參數新增到 /etc/squid/squid.conf 檔案的開頭:
    • CentOS 或 Red Hat Enterprise Linux:

      auth_param negotiate program /usr/lib64/squid/negotiate_kerberos_auth -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<大寫的 realm Active Directory 網域名稱>

      auth_param negotiate children 100 startup=0 idle=10

      auth_param negotiate keep_alive on

      acl authenticated_user proxy_auth REQUIRED

      http_access deny !authenticated_user

    • SUSE Linux Enterprise Server:

      auth_param negotiate program /usr/sbin/negotiate_kerberos_auth -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<大寫的 realm Active Directory 網域名稱>

      auth_param negotiate children 100 startup=0 idle=10

      auth_param negotiate keep_alive on

      acl authenticated_user proxy_auth REQUIRED

      http_access deny !authenticated_user

    • Ubuntu、Debian 或 ALT Server:

      auth_param negotiate program /usr/lib/squid/negotiate_kerberos_auth -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<大寫的 realm Active Directory 網域名稱>

      auth_param negotiate children 100 startup=0 idle=10

      auth_param negotiate keep_alive on

      acl authenticated_user proxy_auth REQUIRED

      http_access deny !authenticated_user

  5. 如果您想要用偵錯模式允許事件記錄,請在 /etc/squid/squid.conf 檔案中將 -d 參數新增到第一個字串。
    • CentOS 或 Red Hat Enterprise Linux:

      auth_param negotiate program /usr/lib64/squid/negotiate_kerberos_auth -d -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<realm Active Directory 網域名稱>

    • SUSE Linux Enterprise Server:

      auth_param negotiate program /usr/sbin/negotiate_kerberos_auth -d -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<大寫的 realm Active Directory>

    • Ubuntu、Debian 或 ALT Server:

      auth_param negotiate program /usr/lib/squid/negotiate_kerberos_auth -d -k /etc/squid/squid.keytab -s HTTP/<託管 Squid 服務的伺服器名稱>@<大寫的 realm Active Directory 網域名稱>

    調試事件將被寫入檔案 /var/log/squid/cache.log。

  6. 如果想要停用重播快取,根據所用的作業系統執行以下操作:
    • 對于 CentOS 或 Red Hat Enterprise Linux,新增以下行到 /etc/sysconfig/squid 檔案:

      KRB5RCACHETYPE=none

    • 對于 Ubuntu 18.04.х、Debian 9.х 或 ALT Server,新增以下行到 /etc/default/squid 檔案:

      KRB5RCACHETYPE=none

    • 對于 SUSE Linux Enterprise Server 15.x 或 Debian 10.x:
      1. 建立名为 /etc/systemd/system/squid.service.d/override.conf 含以下内容的檔案:

        [Service]

        Environment=KRB5RCACHETYPE=none

      2. 執行以下指令:

        systemctl daemon-reload

    預設啟用重播快取

    重播快取提供了更可靠的防護,但是會降低應用程式的效能。

  7. 重啟 Squid 服務。為此,請執行指令:

    service squid restart

  8. 在企業 LAN 電腦上,在瀏覽器設定中,指定作為代理伺服器託管 Squid 服務的伺服器的完整網域名稱(FQDN)。

Squid 服務现在已配置,可使用 Kerberos 身分驗證。

頁面頂端